package com.orhon.smartcampus.modules.material.mm;


import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.SchoolMapper;
import com.orhon.smartcampus.modules.material.entity.Campus;
import com.orhon.smartcampus.modules.material.gqlModel.GQLCampus;

@Mapper(
        uses = {
                LangMapper.class,
                SchoolMapper.class
        }
)
public interface CampusMapper {


    CampusMapper MAPPER = Mappers.getMapper(CampusMapper.class);


    @Mapping(source = "id" , target = "id")
    @Mapping(source = "campusArea" , target = "area")
    @Mapping(source = "campusTel" , target = "tel")
    @Mapping(source = "campusName" , target = "name")
    @Mapping(source = "campusManager" , target = "manager")
    @Mapping(source = "campusPosition" , target = "position")
    @Mapping(ignore = true, target = "school" )
    GQLCampus toCampus(Campus entity);
    
    @InheritConfiguration(name = "toCampus")
    List<GQLCampus> toCampusList(List<Campus> entities);
}
